<?php

namespace app\models\db;

use Yii;

/**
 * This is the model class for table "t_goods_brand_name".
 *
 * @property string $id
 * @property string $name
 * @property string $logo_url
 * @property string $summary
 * @property string $detail_html
 * @property string $mini_programs_id
 * @property string $create_datetime
 *
 * @property Goods[] $tGoods
 */
class GoodsBrandName extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_goods_brand_name';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['detail_html'], 'string'],
            [['create_datetime'], 'safe'],
            [['id', 'mini_programs_id'], 'string', 'max' => 36],
            [['name', 'logo_url', 'summary'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'logo_url' => 'Logo Url',
            'summary' => 'Summary',
            'detail_html' => 'Detail Html',
            'mini_programs_id' => 'Mini Programs ID',
            'create_datetime' => 'Create Datetime',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getTGoods()
    {
        return $this->hasMany(Goods::className(), ['goods_brand_name_id' => 'id']);
    }
}
